# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer:
pkgname=bitritter
pkgver=0_git20240415
pkgrel=0
_commit="0a6b24a27fb28d06b22c6257d00d403889ece377"
pkgdesc="GTK-based bitwarden client"
url="https://codeberg.org/Chfkch/bitritter"
arch="all !s390x" # 'nix' crate fails to compile
license="MIT"
makedepends="
	cargo
	cargo-auditable
	glib-dev
	graphene-dev
	gtk4.0-dev
	libadwaita-dev
	openssl-dev
"
source="
	$pkgname-$_commit.tar.gz::https://codeberg.org/Chfkch/bitritter/archive/$_commit.tar.gz
	bitritter.desktop
	"
builddir="$srcdir/$pkgname"

export PKG_CONFIG_PATH=/usr/lib/pkgconfig

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	glib_sys_NO_PKG_CONFIG=1 \
		cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/bitritter \
		-t "$pkgdir"/usr/bin/
	install -Dm644 "$srcdir"/bitritter.desktop \
		-t "$pkgdir"/usr/share/applications/
}

sha512sums="
1e2e1f11d9ce2dde92da308bb3a1be8a4f57183e20e1f36cf28e12bacfe21357a3ddee91366bb760b233716251243205895e51bf1832090db618a192e7569450  bitritter-0a6b24a27fb28d06b22c6257d00d403889ece377.tar.gz
03b31377d37edbaa3cb2447e02caea0ecaad4a0b78b9adb61d0c218af1be5472090b6cc3a8139ddd40a82bc75e826900033ea4225277cdd0f0f77c34543500be  bitritter.desktop
"
